﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace ARS.Control.Factory
{
    public class PermDataPaging
    {
        /// <summary>
        /// 获取权限判断
        /// </summary>
        /// <returns></returns>
        public static Interface.IPermDataPaging CreatePermDataPaging()
        {
            string AssemblyPath = ConfigurationManager.AppSettings["PermDataPagingAssembly"];
            string ClassNamespace = null;
            if (string.IsNullOrEmpty(AssemblyPath))
            {
                //return new DefaultDialog();
                throw new Exception("没有配置DataPaging权限检测");
            }
            else
            {
                ClassNamespace = ConfigurationManager.AppSettings["PermDataPagingClass"];
            }

            object objType = ARS.PublicTool.ReflectionHelper.CreateObjectNoCache(AssemblyPath, ClassNamespace);
            //if (objType == null)
            //{
            //    //throw new Exception("aaa");
            //}
            return (Interface.IPermDataPaging)objType;
        }
    }
}
